//
//  YAYIChoseHospitalCell.m
//  yayi-医生版
//
//  Created by Veer on 16/4/25.
//  Copyright © 2016年 Veer. All rights reserved.
//

#import "YAYIChoseHospitalHeadCell.h"


@interface YAYIChoseHospitalHeadCell()


@property (nonatomic, weak) UIImageView *localIcon;
@property (nonatomic, weak) UILabel *locationLbl;
@property (nonatomic, weak) UILabel *detailLbl;

@end

@implementation YAYIChoseHospitalHeadCell

//- (void)setItem:(YAYISettingItem *)item
//{
//    _item = item;
//
//    self.textLabel.text = item.title;
//
//    self.tf.placeholder = item.subtitle;
//
//    if (!item.isHaveArrow) {
//        self.accessoryType = UITableViewCellAccessoryNone;
//    }
//}

- (void)setLocationStr:(NSString *)locationStr
{
    _locationStr = locationStr;
    
    self.locationLbl.text = locationStr;
}


+ (instancetype)cellWith:(UITableView *)tablevie
{
    static NSString *cellID = @"choseHospitalHeadCellCell";
    
    YAYIChoseHospitalHeadCell *cell = [tablevie dequeueReusableCellWithIdentifier:cellID];
    
    if (nil == cell) {
        cell = [[YAYIChoseHospitalHeadCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self setupSubView];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    //self.lineView.frame = CGRectMake(0, self.contentView.frame.size.height, SCREEN_width, 1);
    
    [self.localIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@(23));
        make.width.equalTo(@(18));
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(@(15));
    }];
    
    [self.locationLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(150));
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.localIcon.mas_right).offset(8);
    }];
}


- (void)setupSubView
{
    self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
    // icon
    UIImageView *iconView = [[UIImageView alloc] init];
    iconView.image = [UIImage imageNamed:@"home_location"];
    [self.contentView addSubview:iconView];
    self.localIcon = iconView;
    
    // 位置
    UILabel *localLbl = [[UILabel alloc] init];
    localLbl.text = @"浙江1   杭州1";
    localLbl.font = [UIFont systemFontOfSize:16];
    localLbl.textColor = YAYIColor(153, 150, 154);
    [self.contentView addSubview:localLbl];
    self.locationLbl = localLbl;
    
    self.detailTextLabel.font = [UIFont systemFontOfSize:16];
    self.detailTextLabel.textColor = YAYIColor(93, 90, 93);
    self.detailTextLabel.text = @"选择地区";
    
}

@end
